package org.learn.java;

public class ISBN {

	public static void main(String[] args) {
		int n = Integer.parseInt(args[0]);
		int i = 2;
		int sum = 0;
		while (n > 0) {
			sum += ((n % 10) * i);
			n /= 10;
			i++;
		}
		System.out.println(sum);
		int d = 11 - (sum % 11);
		System.out.println(d);
		
	}

}
